<?php
require("../../class/connect.php");
include("../../class/config.php");
$getvar=$_GET['getvar'];
$returnvar=$_GET['returnvar'];
$fun=$_GET['fun'];
//风格
$loginadminstyleid=(int)getcvar('loginadminstyleid');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>在线编辑模板</title>
<link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
<script>
function on()
{
var f=document.edittemp
f.HTML.value=f.pagetext.value;
}
function bs(){
var f=document.edittemp
f.pagetext.value=f.HTML.value;
}
function br(){
if(!confirm("是否复位？")){return false;}
document.edittemp.title.select()
}
</script>
<script>
function SaveTemp()
{
var isok=confirm('确认要保存?');
if(isok)
{
<?=$returnvar?>=editor.getHTML();
window.close();
}
return false;
}
</script>
<noscript>
<iframe src=*.htm></iframe>
</noscript>
</head>

<body onload="on();">
  
<table width="100%" border="0" cellspacing="1" cellpadding="3" class="tableborder">
  <form name="edittemp" method="post" action="../enews.php" onsubmit="return SaveTemp()">
    <tr class="header"> 
      <td>在线编辑模板</td>
    </tr>
    <tr>
      <td bgcolor="#FFFFFF">
<div align="center"> 
          <input type="button" name="Submit" value=" 保存内容 " onclick="return SaveTemp()">
        </div></td>
    </tr>
    <tr> 
      <td bgcolor="#FFFFFF"><div align="center">
	  <OBJECT id=HTML data=../editor/t_editor.html width=760 height=460 type=text/x-scriptlet>
        </object>
<textarea id="pagetext" style="DISPLAY:none" name="pagetext"></textarea>
</div>
</td>
    </tr>
    <tr> 
      <td bgcolor="#FFFFFF">
<div align="center">
          <input type="button" name="Submit2" value=" 保存内容 " onclick="return SaveTemp()">
        </div></td>
    </tr>
	</form>
  </table>
<script>
var mytext=<?=$getvar?>;
//mytext=mytext.replace("<","&lt;");
//mytext=mytext.replace(">","&gt;");
document.edittemp.pagetext.value=mytext;
</script>
</body>
</html>
